package com.example.Service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.Service.ExchangeService;
import com.example.dao.ExchangeMapper;
import com.example.pojo.Exchange;
import com.example.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ExchangeServiceImpl extends ServiceImpl<ExchangeMapper, Exchange> implements ExchangeService {

    @Autowired
    private ExchangeMapper exchangeMapper;

    public List<User> selectAllLinkman() {
        return exchangeMapper.selectAllLinkman();
    }

    public List<Exchange> chattingRecordsBySenderAndRecipient(String sender, String recipient) {
        return exchangeMapper.chattingRecordsBySenderAndRecipient(sender,recipient);
    }

    public void senderExchange(Exchange exchange) {
        exchangeMapper.senderExchange(exchange);
    }

    public List<Exchange> senderUnreadQuantity(String sender) {
        return exchangeMapper.senderUnreadQuantity(sender);
    }

    public void updateUnread(String sender, String recipient) {
        exchangeMapper.updateUnread(sender,recipient);
    }
}
